<?php
//前台访问控制器
namespace app\expbao\home;
use app\expbao\common\controller\ExController;
class Cars extends ExController
{
//前台访问控制器
    public function index()
    {
        //var_dump( module_config('cms.contact'));
        
        $request= \think\Request::instance();
		//dump($request->controller());
		dump($request->module());
		dump($request->controller());
		dump($request->action());
		$user_id=$this->is_login_exp();
        return $this->fetch(); // 渲染模板
    }
    public function FunctionName($value='')
    {
    	 if ($this->request->isPost()) {

        } else {
            $user_id=$this->is_exp_login();
            if($user_id){
            //echo "已经登录";
           //$test="已经登录";
           //$userinfo = ExUserModel::where($user_id)->find();
           $request= \think\Request::instance();
           if($request){
                $fun=$request->action();
                $optid=ExOptModel::getidbyfun($fun);
                var_dump($optid);
                $isbind=ExOptUserModel::where('oid',$optid)->value('isbind');
                $opt_user_id=ExOptUserModel::where('oid',$optid)->value('id');
                var_dump($isbind);
                if($isbind==0){
                    $this->error('没有访问权限',url('/expbao/ucenter/active/optuserid/'.$opt_user_id));
                    var_dump($isbind);
                }
           };
           $opts = ExOptModel::column('id');
            dump($request->module());
            dump($request->action());
           $userinfo=ExUserModel::getuserinfo($user_id);
           $useropt=ExUserModel::getuseropt($user_id);
           //var_dump($useropts);
           $data_list = ExOptUserModel::table('__EXPBAO_OPERATION_USER__')
            ->alias('t1')
//            ->field('t1.id,t1.status,t1.gc_name,t1.pid,t2.gc_name as pname')
            ->join('expbao_operation t2','t1.oid = t2.id','LEFT')
            ->where('uid',$user_id)
            ->order('order','asc')
            ->select();
        $this->assign('data_list',$data_list);
        //$this->assign('useropt', $useropts);
        $this->assign('user_id', $user_id);
        $this->assign('userinfo', $userinfo);
        //$this->assign('test', $test);
        }else{
            //$test="未登录";
            //echo "没有登录";
            //$xxx=ExUserModel::test();
            //echo $xxx;
           //$this->error("没有登录");
           $this->error('没有登录', url('ucenter/login'));
        }
            return $this->fetch(); 
        }
    }
}